package org.ch02.test00.demo10.myWork;

import org.ch02.entity.Staffs;

import java.util.Date;

/**
 *
 * 十一、定义一个工具类：BeanUtil,有以下三个方法：
 *     1、设置何意对象的属性值
 *     public static void setProperty(Object bean, String propertyName, Object value)
 *
 *     2、获取任意对象的属性值
 *     public static Object getProperty(Object bean, String propertyName)
 *
 *     3、复制某个对象的属性值到另一个对象中
 *     public static void copyProperties(Object source, Object target)
 * @author CSY
 * @date 2025 - 03 - 19
 */
public class MainTest {
    public static void main(String[] args) {
        BeanUtil<Staffs,String> beanUtil = new BeanUtil<>();
        Staffs staff = new Staffs(1,"张三",18,"123456","老师",new Date(),new Date());
        Staffs s = new Staffs();
        beanUtil.copyProperties(staff,s);
        System.out.println(s);
    }
}
